UPS stands for "uninterruptible power supply". Basically, it's a rechargeable battery to which you connect a computer (or any other device); In case of a power failure, the battery "comes to life" and gives you a few extra minutes to save your work.
What's UPSMon good for?
Imagine the following scene: you leave your room and your Mac is still on. Some time after you leave the power goes off, and the UPS comes to life. The battery keeps your Mac going for ten minutes, but the Mac has no idea it's on battery power and keeps doing whatever it's been doing. The battery dies at a certain point and the electronic current to your Mac is cut off brutally. The disks are left unsynced and all activities are stopped, possibly causing damage. UPSMon will make sure your Mac shuts down properly!
Hardware details
Most UPSes come with a communications port (usually a DB-9 port) on them. You can use this port to access several relays in the UPS and thus check its status.
A special cable is required to connect the UPS to your Mac. You should build this cable according to the technical specifications of your UPS's port. See the diagram in the attached picture for the wire-up.
The idea is to connect the Power Failure relay to the TxD-/RxD- pins on the Mac serial port and to wire the Battery Low relay to the HSKi/Ground pins on the Mac serial port.
You can use Normally-Closed relays if your UPS supports them. This means the TxD-/RxD- pins would normally be connected and the connection will be broken if the power goes out. This method is preferrable because it could detect problems with the cable.
You can connect the UPS to any of your serial ports. UPS Monitor is CTB-aware and can work with all CTB serial ports (e.g. QuadraLink cards, Hurdler cards, AppleTalk ADSP...).
Sample wirings:
To connect a TENSOR T-106B UPS, use the following wiring scheme:
Pin on Mac Serial Port Pin on UPS
3 2
5 7
2 5
4 8
With this wiring, both relays are normally closed.
To connect a APC-400 UPS, use the following wiring scheme:
Pin on Mac Serial Port Pin on UPS
3 4
5 6
Only the power failure relay is connected, and it's normally closed.
With this wiring, use the timed automatic shutdown.
Software Details
UPS Monitor sends status requests to the UPS and shuts down your Mac automatically - if the system is on battery power - after a specified period of time, or if a Battery Low signal is received.
If the system is on battery power and a shutdown is required, UPS Monitor can Force-Quit all running applications, run a QuicKeys 3.0 macro or run a KeyQuencer macro, and will eventually perform a software shutdown, synchronizing the disks. Most applications will quit properly when Force-Quit, and for those that don't you can use the QuicKeys/KeyQuencer macro.
If you choose the Force-Quit option or the QuicKeys/KeyQuencer option, UPSMon would wait a full minute (by default) before shutting down to let the applications finish up properly.
By default, UPSMon will not kill itself, the Finder, QuicKeys Toolbox and KQ Apple Events; you can modify this list of excluded applications with ResEdit (edit STR# 128).
The QuicKeys/KeyQuencer macros are stored in 'STR ' resources 1000 and 1001; you can modify them with ResEdit.
UPS Monitor can keep a log file of the UPS's status, for future reference.
The status requests are sent to the UPS at a fixed rate which can be changed in the configuration dialog. A higher rate is safer but takes up more CPU time. When UPSMon is in the background, you'll hardly notice its activity if the delay between requests is more than 5 seconds.
After connecting the UPS to your Mac, run UPS Monitor and choose "Configure" from the menu. Configure it according to your needs and click OK. Put UPS Monitor in your "Startup Items" folder in the System Folder.
UPS Monitor has been thoroughly tested on a IIci running System 7.1 and a PowerMac 6100/60 running System 7.1.2. I didn't have the chance to test it on System 7.5.
Version History
Changes since version 1.5
* Version 1.51 fixes a minor bug on extra-loaded systems. UPSMon 1.5 couldn't
handle more than 10 CTB ports; 1.51 is preconfigured to 15 ports and can be
configured to more ports, just change STR resource #131 with ResEdit.
If you open UPSMon and it just beeps and quit, check the log file created.
* Version 1.52 fixes another minor bug which caused popup menu items to be
dimmed.
* UPSMon now requires a 68020, and runs nicely on PowerMacs, under emulation.
* Version 1.53 adds the option to run QuicKeys and KeyQuencer macros on
shutdown. Using ResEdit, change STR resource 1000 to the QuicKeys macro name
you wish to play and STR resource 1001 to the KeyQuencer macro you wish to
execute.
* Another new feature in 1.53: UPSMon can send a QUIT Apple Event ("ForceQuit")
to all running applications. A list of exceptions is in STR# resource 128.
* UPSMon would give QuicKeys, KeyQuencer and the quitted applications some
extra time to finish up - 60 seconds by default.
* The Automatic Shutdown timeout can now be entered in seconds.
Changes since version 1.4
* Added support for external serial ports, with peripheral cards such as
QuadraLink or Hurdler. In general, UPS Monitor is CTB-aware and will recognize
all CTB serial ports, including virtual ports defined with PortConnector.
All you have to do is select the right port from the pop-up menu in the
Configuration dialog, just like in ZTerm.
* Fixed a bug with the dates.
* Converted date translation to support international date formats. Dates will
now appear the same way they do in the Date&Time control panel.
Changes since version 1.3
* Dialog box redesigned to avoid confusion.
* Alert option removed.
* Added variable serial driver support.
Changes since version 1.2
* Fixed a few bugs: "File" menu stayed highlighted after configuring, the
baud setting always defaulted to 2400 baud, the Select Logfile button
didn't work.
* Added a full VERS resource.
* Changed the main GetNextEvent call to WaitNextEvent, thus making UPSMon
less CPU intensive.
* Added an option to monitor normally closed relay contacts.
Changes since version 1.1
* Added Log file option.
* Added Modem/Printer port selection.
* Added "Battery Low" mode support.
Changes since version 1.0
* Fixed a bug that caused UPS Monitor to refuse to quit when shutting down
or restarting.
* Added AppleEvent QUIT support.
* Changed the menu title to "File" instead of "Monitor" to help system 6
users quit UPS Monitor automatically.
Support
Comments, feature/design suggestions, bug reports etc. - send email to
Internet: yair@tamar.cc.biu.ac.il
If you need help on how to wire the cable, send me the wiring scheme of your UPS's port via e-mail or snail mail. Most UPSs have easy-to-read diagrams found in the back pages of the manuals.
UPS Monitor is shareware and may be freely distributed as long as no modifications are made and this text file is included. If you decide to keep it, please send a donation of $15 to: